package cn.moningxi.service.impl;

import cn.moningxi.bean.CLevelInfo;
import cn.moningxi.mapper.CLevelInfoMapper;
import cn.moningxi.service.CLevelInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class CLevelInfoServiceImpl implements CLevelInfoService {

    @Autowired
    private CLevelInfoMapper cLevelInfoMapper;

    @Override
    public CLevelInfo selectByPrimaryKey(Integer customerLevelId) {
        return cLevelInfoMapper.selectByPrimaryKey(customerLevelId);
    }

    @Override
    public List<CLevelInfo> queryAll() {
        return cLevelInfoMapper.queryAll();
    }

    @Override
    public CLevelInfo queryLevelInfoById(Integer levelId) {
        return cLevelInfoMapper.queryLevelInfoById(levelId);
    }

    @Override
    public void updateLevelInfo(CLevelInfo cLevelInfo) {
        cLevelInfoMapper.updateLevelInfo(cLevelInfo);
    }

    @Override
    public void addLevel(CLevelInfo cLevelInfo) {
        cLevelInfo.setModifiedTime(LocalDateTime.now());
        cLevelInfoMapper.addLevel(cLevelInfo);
    }
}
